Ccay.Module.define("Ccay.example.ui.igird.operation",function(page,$S){
	
	page.ready = function(){ 
		var linkBtns = [
			{text: "${name}", click: page.operateTest}
		];
		
		var showLastDate = {
			getFormat: function (field, format){
				return "${#Ccay.Format.toDateBefore({0})}".formatText(field);
			},
			format: function (value, format){
	    		return Ccay.Format.toDateBefore(value);
	    	},
			render: function (target, value, format) {
	        	target.html(this.format(value, format));
	    	}
		};
		
		//---------- demo增删改查---------------------------------------------------
		var gridOption1 = {
			height: 300,
			wrap: true,
			editMode: true,
			storageOp:{
				cache: true, // 是否缓存数据
				cacheKey: ["id"] // 缓存key
			},
		    columns: [
		        {columnType: "select", multi: true},
		 		{field: "name", width: 70, header: "ccay.common.label.name", freezeable:true, rule: {required: true}},
		 		{field: "sex", width:50, header: "sSex", type: 'bool', format: {isIcon: true},editorOp:{shortChecked:true}},
		 		{field: "age", width:50, header: "sAge", type: 'integer', rule: {range: [16, 80],required: true}},
		 		{field: "birthday", width:180, header: "sBirthday", type: 'datetime', format: {dateFormat:'yyyy/MM/dd hh:mm:ss'},content:"${#toUtcTime(data)}"},
		 		{field: "province", width:80, header: "sProvince", type: 'lookup', editorOp: {id: "comboProvince",afterTrigger:["city"]}, format: {code: "province", supportLang: true}},
		 		{field: "address", valueField: 'city', width:70, header: "sCity", type: 'enum', editorOp: {trigger:["province"],conf:{connector:"#comboProvince",lazyload:false,ajax:{url:'services/ccay/lookup/itemquery/list/city/{0}'}}}, format: {valueField:"itemCode",displayField:"itemName"}},
		 		{field: "tuition", width:100, header: "sPass", type: 'rate', format: {htmlView: true, section: [20, 50, 60]}},
		 		{field: "phone", width:100, header: "sTuition", type: 'currency', format:{fraction:2, flag:'￥[currency]'}, rule: {max: 9999999999, min: -9999999999}},
		 		//{field: "card", width:90, header: "sHobby", type: 'enum', format:{service:'LOOKUP:LOOKUP_COMBOBOX',valueField:'itemCode',displayField:'itemName'}},
		 		{field: 'hobby', width:90, header: "sHobby", type: 'enum', format:{service:'ENUM:HobbyEnum'}},
		 		{field: 'hobbies', width:90, header: "sHobbies", type: 'enum', editorOp: {conf:{multi: true}},format:{service:'ENUM:HobbyEnum'}},
		 		{field: "mail", width:100, header: "sMail",  rule: {email: true}},
		 		{field: "blog", width:170, header: "sBlog", type:'textarea', rule: {url: true}},
		 		{field: "lastUpdateDate", width:130, header: "ccay.common.label.lastUpdatedDate", editable: false, type: 'datetime', content:"${#getLastTime(lastUpdateDate)}"},
	 		 	{field: "country",width:110, header: "country", type: 'country'},
		 		{field: "companyName",valueField:"companyCode",width:110, header: "company", type: 'company'},
		 		{field: "currency",width:110, header: "iCurrency", type: 'iCurrency'},
		 		{field: "areaName",valueField:"areaCode",width:110, header: "area", type: 'area',format:{areaLabel:"Region"}},
		 		{field: 'location',width:110, header: "location", type: 'location',format:{level:1},editorOp: {trigger: ["attr1", "attr2"]}},
		 		{field: 'attr1',width:110, header: "location(1)", type: 'location',format:{level:2,connector:"#location"},editorOp: {trigger: ["location", "attr2"]}},
		 		{field: 'attr2',width:110, header: "location(2)", type: 'location',format:{level:3,connector:"#attr1"},editorOp: {trigger: ["location", "attr1"]}},
		 		{field: "pbi",width:110, header: "pbi", type: 'pbi',format:{readonly:true}}
		    ],
			ajax: {
			   	url: 'services/ccay/demo/student/list/page/${pageSize}/${curPage}/${orderBy}'
			},
			fnBeforeEdit:function(value, td, col, rowData){
				debugger
				if(col.sortField="province" &&rowData.name=='123' ) {
				   $("#comboProvince").manager().reBind(
						   null, [
						          { itemCode: '刘二', itemName: '0' },
						          { itemCode: '张三', itemName: '1' },
				                   { itemCode: '李四', itemName: '2' },
				                   { itemCode: '赵武', itemName: '44' }
				                  ]);
				}
			},
		    operation: {
		    	search: {
		    		btn: '#btnSearch',
					panel: '#searchForm'
		    	},
		    	del: {
		    		btn: '#btnDel',
		    		undoBtn: '#btnUndoDel'
		    	},
		    	insert: {
		    		btn: '#btnAdd',
		    		copy: true,
		    		clear: ['id', 'name', 'lastUpdateDate'],
		    		defaultRow:{sex:1, blog:'http://', tuition:'0'}
		    	},
		    	save: {
		    		btn: '#btnSave',
		    		fnBeforeSave:function(params,ajax, grid, optOp){
		    			$.each(params.items2Create, function(i, row){
		    				if(row.hobbies){
		    					row.hobbies = row.hobbies.split(",");
		    				}
		    			});
		    			$.each(params.items2Update, function(i, row){
		    				if(row.hobbies){
		    					row.hobbies = row.hobbies.split(",");
		    				}
		    			});
		    			//debugger;
		    			
		    		},
		    		ajax: {
		    			url: "services/ccay/demo/student/batch"
		    		}
		    	}
		    }
		};
		 
		//----------加载完成之后全选--------------------------------------------------- 
		var gridOptionAll = {
				height: 300,
				wrap: true,
				editMode: true,
				storageOp:{
					cache: true, // 是否缓存数据
					cacheKey: ["id"] // 缓存key
				},
			    columns: [
			        {columnType: "select", multi: true},
			 		{field: "name", width: 70, header: "ccay.common.label.name", freezeable:true, rule: {required: true}},
			 		{field: "sex", width:50, header: "sSex", type: 'bool', format: {isIcon: true},editorOp:{shortChecked:true}},
			 		{field: "age", width:50, header: "sAge", type: 'integer', rule: {range: [16, 80]}},
			 		{field: "birthday", width:180, header: "sBirthday", type: 'datetime', format: {dateFormat:'yyyy/MM/dd hh:mm:ss'},content:"${#toUtcTime(data)}"},
			 		{field: "province", width:80, header: "sProvince", type: 'lookup', editorOp: {id: "comboProvince",afterTrigger:["city"]}, format: {code: "province", supportLang: true}},
			 		{field: "address", valueField: 'city', width:70, header: "sCity", type: 'enum', editorOp: {trigger:["province"],conf:{connector:"#comboProvince",lazyload:false,ajax:{url:'services/ccay/lookup/itemquery/list/city/{0}'}}}, format: {valueField:"itemCode",displayField:"itemName"}},
			 		{field: "tuition", width:100, header: "sPass", type: 'rate', format: {htmlView: true, section: [20, 50, 60]}},
			 		{field: "phone", width:100, header: "sTuition", type: 'currency', format:{fraction:2, flag:'￥[currency]'}, rule: {max: 9999999999, min: -9999999999}},
			 		//{field: "card", width:90, header: "sHobby", type: 'enum', editorOp: {conf:{multi: true}}, format:{service:'FN:Ccay.example.ui.igird.operation.hobbyData',valueField:'pCode',displayField:'pName'}},
			 		{field: "hobby", width:90, header: "sHobby", type: 'enum', editorOp: {conf:{multi: true}}, format:{service:'FN:Ccay.example.ui.igird.operation.hobbyData',valueField:'pCode',displayField:'pName'}},
			 		{field: "mail", width:100, header: "sMail",  rule: {email: true}},
			 		{field: "blog", width:170, header: "sBlog", type:'textarea', rule: {url: true}},
			 		{field: "lastUpdateDate", width:130, header: "ccay.common.label.lastUpdatedDate", editable: false, type: 'datetime', content:"${#getLastTime(lastUpdateDate)}"},
		 		 	{field: "country",width:110, header: "country", type: 'country'},
			 		{field: "companyName",valueField:"companyCode",width:110, header: "company", type: 'company'},
			 		{field: "currency",width:110, header: "iCurrency", type: 'iCurrency'},
			 		{field: "areaName",valueField:"areaCode",width:110, header: "area", type: 'area',format:{areaLabel:"Region"}},
			 		{field: 'location',width:110, header: "location", type: 'location',format:{level:1},editorOp: {trigger: ["attr1", "attr2"]}},
			 		{field: 'attr1',width:110, header: "location(1)", type: 'location',format:{level:2,connector:"#location"},editorOp: {trigger: ["location", "attr2"]}},
			 		{field: 'attr2',width:110, header: "location(2)", type: 'location',format:{level:3,connector:"#attr1"},editorOp: {trigger: ["location", "attr1"]}},
			 		{field: "pbi",width:110, header: "pbi", type: 'pbi',format:{readonly:true}}
			    ],
				ajax: {
				   	url: 'services/ccay/demo/student/list/page/${pageSize}/${curPage}/${orderBy}'
				},
				fnDataBindComplete:function(){
				      var grid=$S("#iGrid1All").manager();
				      grid.getHeadTable().find("td.igrid-selectAll").click();
				 },
			    operation: {
			    	search: {
			    		btn: '#btnSearchAll',
						panel: '#searchFormAll'
			    	},
			    	del: {
			    		btn: '#btnDelAll',
			    		undoBtn: '#btnUndoDelAll'
			    	},
			    	insert: {
			    		btn: '#btnAddAll',
			    		copy: true,
			    		clear: ['id', 'name', 'lastUpdateDate'],
			    		defaultRow:{sex:1, blog:'http://', tuition:'0'}
			    	},
			    	save: {
			    		btn: '#btnSaveAll',
			    		ajax: {
			    			url: "services/ccay/demo/student/batch"
			    		}
			    	}
			    }
			};
		
		//----------点击保存的时候 结束编辑---------------------------------------------------
		var gridOptionDitMode = {
				height: 300,
				wrap: true,
				editMode: true,
				storageOp:{
					cache: true, // 是否缓存数据
					cacheKey: ["id"] // 缓存key
				},
			    columns: [
			        {columnType: "select", multi: true},
			 		{field: "name", width: 70, header: "ccay.common.label.name", freezeable:true, rule: {required: true}},
			 		{field: "sex", width:50, header: "sSex", type: 'bool', format: {isIcon: true},editorOp:{shortChecked:true}},
			 		{field: "age", width:50, header: "sAge", type: 'integer', rule: {range: [16, 80],required: true}},
			 		{field: "birthday", width:180, header: "sBirthday", type: 'datetime', format: {dateFormat:'yyyy/MM/dd hh:mm:ss'},content:"${#toUtcTime(data)}"},
			 		{field: "province", width:80, header: "sProvince", type: 'lookup', editorOp: {id: "comboProvince",afterTrigger:["city"]}, format: {code: "province", supportLang: true}},
			 		{field: "address", valueField: 'city', width:70, header: "sCity", type: 'enum', editorOp: {trigger:["province"],conf:{connector:"#comboProvince",lazyload:false,ajax:{url:'services/ccay/lookup/itemquery/list/city/{0}'}}}, format: {valueField:"itemCode",displayField:"itemName"}},
			 		{field: "tuition", width:100, header: "sPass", type: 'rate', format: {htmlView: true, section: [20, 50, 60]}},
			 		{field: "phone", width:100, header: "sTuition", type: 'currency', format:{fraction:2, flag:'￥[currency]'}, rule: {max: 9999999999, min: -9999999999}},
			 		//{field: "card", width:90, header: "sHobby", type: 'enum', format:{service:'LOOKUP:LOOKUP_COMBOBOX',valueField:'itemCode',displayField:'itemName'}},
			 		{field: 'hobby', width:90, header: "sHobby", type: 'enum', format:{service:'ENUM:HobbyEnum'}},
			 		{field: "mail", width:100, header: "sMail",  rule: {email: true}},
			 		{field: "blog", width:170, header: "sBlog", type:'textarea', rule: {url: true}},
			 		{field: "lastUpdateDate", width:130, header: "ccay.common.label.lastUpdatedDate", editable: false, type: 'datetime', content:"${#getLastTime(lastUpdateDate)}"},
		 		 	{field: "country",width:110, header: "country", type: 'country'},
			 		{field: "companyName",valueField:"companyCode",width:110, header: "company", type: 'company'},
			 		{field: "currency",width:110, header: "iCurrency", type: 'iCurrency'},
			 		{field: "areaName",valueField:"areaCode",width:110, header: "area", type: 'area',format:{areaLabel:"Region"}},
			 		{field: 'location',width:110, header: "location", type: 'location',format:{level:1},editorOp: {trigger: ["attr1", "attr2"]}},
			 		{field: 'attr1',width:110, header: "location(1)", type: 'location',format:{level:2,connector:"#location"},editorOp: {trigger: ["location", "attr2"]}},
			 		{field: 'attr2',width:110, header: "location(2)", type: 'location',format:{level:3,connector:"#attr1"},editorOp: {trigger: ["location", "attr1"]}},
			 		{field: "pbi",width:110, header: "pbi", type: 'pbi',format:{readonly:true}}
			    ],
				ajax: {
				   	url: 'services/ccay/demo/student/list/page/${pageSize}/${curPage}/${orderBy}'
				},
				 onRowClick:function(value,rowData,td,tr){
						//Igrid结束编辑
						var igrid = $("#iGrid1DitMode").manager();
						var activeEditor = igrid.getActiveEditor() || [];
						$.each(activeEditor,function(i,editor){
						    Ccay.UI.IGrid.Editor.endEdit(editor,igrid,igrid.op);
						});
						igrid.clearActiveEditor();
					},
			    operation: {
			    	search: {
			    		btn: '#btnSearchDitMode',
						panel: '#searchFormDitMode'
			    	},
			    	del: {
			    		btn: '#btnDelDitMode',
			    		undoBtn: '#btnUndoDelDitMode'
			    	},
			    	insert: {
			    		btn: '#btnAddDitModeDitMode',
			    		copy: true,
			    		clear: ['id', 'name', 'lastUpdateDate'],
			    		defaultRow:{sex:1, blog:'http://', tuition:'0'}
			    	},
			    	save: {
			    		btn: '#btnSaveDitModeDitMode',
			    		ajax: {
			    			url: "services/ccay/demo/student/batch"
			    		}
			    	}
			    }
			}; 
		
		 //--------------------- 点击insert增加行时是在参考行前还是参考行后----------------------------------------
		 var gridOptionInsert = {
		      height: 300,
		      wrap: true,
		      editMode: true,
		      storageOp:{
		      cache: true, // 是否缓存数据
		      cacheKey: ["id"] // 缓存key
	      },
        columns: [
            {columnType: "select", multi: true},
        {field: "name", width: 70, header: "ccay.common.label.name", freezeable:true, rule: {required: true}},
        {field: "sex", width:50, header: "sSex", type: 'bool', format: {isIcon: true},editorOp:{shortChecked:true}},
        {field: "age", width:50, header: "sAge", type: 'integer', rule: {range: [16, 80]}},
        {field: "birthday", width:180, header: "sBirthday", type: 'datetime', format: {dateFormat:'yyyy/MM/dd hh:mm:ss'},content:"${#toUtcTime(data)}"},
        {field: "province", width:80, header: "sProvince", type: 'lookup', editorOp: {id: "comboProvince",afterTrigger:["city"]}, format: {code: "province", supportLang: true}},
        {field: "address", valueField: 'city', width:70, header: "sCity", type: 'enum', editorOp: {trigger:["province"],conf:{connector:"#comboProvince",lazyload:false,ajax:{url:'services/ccay/lookup/itemquery/list/city/{0}'}}}, format: {valueField:"itemCode",displayField:"itemName"}},
        {field: "tuition", width:100, header: "sPass", type: 'rate', format: {htmlView: true, section: [20, 50, 60]}},
        {field: "phone", width:100, header: "sTuition", type: 'currency', format:{fraction:2, flag:'￥[currency]'}, rule: {max: 9999999999, min: -9999999999}},
        {field: 'hobby', width:90, header: "sHobby", type: 'enum', format:{service:'ENUM:HobbyEnum'}},
        //{field: "card", width:90, header: "sHobby", type: 'enum', editorOp: {conf:{multi: true}}, format:{service:'FN:Ccay.example.ui.igird.operation.hobbyData',valueField:'pCode',displayField:'pName'}},
        {field: "mail", width:100, header: "sMail",  rule: {email: true}},
        {field: "blog", width:170, header: "sBlog", type:'textarea', rule: {url: true}},
        {field: "lastUpdateDate", width:130, header: "ccay.common.label.lastUpdatedDate", editable: false, type: 'datetime', content:"${#getLastTime(lastUpdateDate)}"},
        {field: "country",width:110, header: "country", type: 'country'},
        {field: "companyName",valueField:"companyCode",width:110, header: "company", type: 'company'},
        {field: "currency",width:110, header: "iCurrency", type: 'iCurrency'},
        {field: "areaName",valueField:"areaCode",width:110, header: "area", type: 'area',format:{areaLabel:"Region"}},
        {field: 'location',width:110, header: "location", type: 'location',format:{level:1},editorOp: {trigger: ["attr1", "attr2"]}},
        {field: 'attr1',width:110, header: "location(1)", type: 'location',format:{level:2,connector:"#location"},editorOp: {trigger: ["location", "attr2"]}},
        {field: 'attr2',width:110, header: "location(2)", type: 'location',format:{level:3,connector:"#attr1"},editorOp: {trigger: ["location", "attr1"]}},
        {field: "pbi",width:110, header: "pbi", type: 'pbi',format:{readonly:true}}
        ],
      ajax: {
          url: 'services/ccay/demo/student/list/page/${pageSize}/${curPage}/${orderBy}'
      },
        operation: {
          search: {
            btn: '#btnSearchInsert',
          panel: '#searchFormInsert'
          },
          del: {
            btn: '#btnDelInsert',
            undoBtn: '#btnUndoDelInsert'
          },
          insert: {
            btn: '#btnAddInsert',
            copy: true,
            clear: ['id', 'name', 'lastUpdateDate'],
            defaultRow:{sex:1, blog:'http://', tuition:'0'},
            
            _getInsertSet:function(grid,op){
                  return{
                  position:"after",//新添加是在参考前还是参考后（first/after）
                  posTr: grid.getDataBody().children(':last') //新添行是 在列表最前还是最后位置(:last/:first) 
                  }
            }
          },
          save: {
            btn: '#btnSaveInsert',
            ajax: {
              url: "services/ccay/demo/student/batch"
            }
          }
        }
    };
		
		var imgBtns = [
			{text: "ccay.workflow.label.edit", click: page.editTest, type: 'img', imgtype:'edit', isIi8n: true},
			{text: "ccay.workflow.label.delete", click: page.deleteTest, type: 'img', imgtype:'del', isIi8n: true},
	    	{text: "view", click: "alert('view')", type: 'img', imgtype: 'view', permission: "Service$HtmlArea$read"}
		];

		//--------------------- 图标列增删改查----------------------------------------
		var gridOption2 = {
			height: 300,
			wrap: true,
		    columns: [
		        {field: 'id', columnType: 'select', multi: true},
		    	{width: 70, freezeable: true, columnType: 'operate', btns: imgBtns},
		 		{field: 'name', width: 70, header: "ccay.common.label.name", freezeable:true},
		 		{field: 'sex', width:50, header: "sSex", type: 'bool', format: {isIcon: true}},
		 		{field: 'age', width:50, header: "sAge", type: 'integer'},
		 		{field: 'birthday', width:80, header: "sBirthday", type: 'date'},
		 		{field: 'province', width:80, header: "sProvince", type: 'lookup', format: {code: "province", supportLang: true}},
		 		{field: 'city', width:70, header: "sCity", type: 'lookup', format: {code: "city", supportLang: true}},
		 		{field: 'tuition', width:100, header: "sPass", type: 'rate', format: {htmlView: true, section: [20, 50, 60]}},
		 		{field: 'phone', width:100, header: "sTuition", type: 'currency', format:{fraction:2, flag:'￥[currency]'}},
		 		{field: 'hobby', width:90, header: "sHobby", type: 'enum', format:{service:'ENUM:HobbyEnum'}},
		 		{field: 'select', width:90, header: "sSelect", type: 'enum', format:{service:'FN:Ccay.example.ui.igird.operation.hobbyData',valueField:'pCode',displayField:'pName'}},
		 		{field: 'mail', width:100, header: "sMail"},
		 		{field: 'blog', width:170, header: "sBlog", type:'textarea'},
		 		{field: 'lastUpdateDate', width:130, header: "ccay.common.label.lastUpdatedDate", type: 'datetime', content:"${#getLastTime(lastUpdateDate)}"}
		    ],
			ajax: {
			   	url: 'services/ccay/demo/student/list/page/${pageSize}/${curPage}/${orderBy}'
			},
		    operation: {
		    	search: {
		    		btn: '#btnIconSearch',
					panel: '#searchIconForm'
		    	},
		    	del: {
		    		btn: '#btnIconDel',
		    		url: "services/ccay/demo/student/delete",
		    		fnConfirm: function(result){
		    			if (result)
		    				alert("您点击了确定按钮");
		    			else
		    				alert("您点击了取消按钮！");
		    		}
		    	}
		    }
		};
		
		$S("#operationDemo").ccayTab();
		
		//点击tab头后，才加载数据，只第一次生效
		$S("li[tabid='tab1']").one("click", function () {
			$S("#sex1").dropdown({showfirstItem:false}, [{value:0, text:"女"},{value:1, text:"男"}]);
			$S("#iGrid1").igrid(gridOption1);
		});
		
		$S("li[tabid='tabAll']").one("click", function () {
			$S("#sex1All").dropdown({showfirstItem:false}, [{value:0, text:"女"},{value:1, text:"男"}]);
			$S("#iGrid1All").igrid(gridOptionAll);
		});
		
		$S("li[tabid='tabeDitMode']").one("click", function () {
			$S("#sex1DitMode").dropdown({showfirstItem:false}, [{value:0, text:"女"},{value:1, text:"男"}]);
			$S("#iGrid1DitMode").igrid(gridOptionDitMode);
		});
		
		$S("li[tabid='tab1Insert']").one("click", function () {
			$S("#sexInsert").dropdown({showfirstItem:false}, [{value:0, text:"女"},{value:1, text:"男"}]);
			$S("#iGridInsert").igrid(gridOptionInsert);
		});
		
		$S("li[tabid='tab2']").one("click", function () {
			$S("#sex2").dropdown({showfirstItem:false}, [{value:0, text:"女"},{value:1, text:"男"}]);
			$S("#iGrid2").igrid(gridOption2);
		});
	};
	getLastTime = function(data){
		return Ccay.Format.toDateBefore(data && data.getUTCTime());
	}; 
	page.hobbyData = function(){
		var provinceList = [
			{"pCode": 0, "pName": "旅游"},
			{"pCode": 1, "pName": "睡觉"},
			{"pCode": 2, "pName": "唱歌"},
			{"pCode": 3, "pName": "书法"},
			{"pCode": 4, "pName": "绘画"},
			{"pCode": 5, "pName": "棋牌"},
			{"pCode": 6, "pName": "玩电脑"}
		];
		return provinceList;
	};
	toUtcTime = function(data){
		return Ccay.Format.toUTCDateTimeStr(data,data.birthday);
	}
	page.operateTest = function (value) {
		alert(Ccay.DataHelper.toJsonStr(value));
	};
	
	page.editTest = function (rowData) {
		Ccay.Page.register("Ccay.example.ui.igird.showStudent","ccay/example/ui/igrid/showStudent.html");
		var showDlgOps = {
			width: 420,
			height: 370,
			cancelClick: true,
			okClick: function(){
				Ccay.example.ui.igird.showStudent.save();
			},
			fnLoad: function(){
				Ccay.example.ui.igird.showStudent.init(rowData);
			}
		};
		Ccay.UI.dialog("Ccay.example.ui.igird.showStudent", "ccay.workflow.label.edit", showDlgOps);
	};
	
	page.deleteTest = function (rowData) {
		Ccay.UI.confirm("ccay.common.message.confdel", function (result) {
			if (result && rowData) {
				var dataObj = {items2Create:[], items2Update:[], items2Delete:[rowData]};
				Ccay.doPut("services/ccay/demo/student/batch", dataObj, function(){
					Ccay.UI.topBox("ccay.common.message.success");
					$("#iGrid2").manager().reload(false, true);
				});
			}
		});
	};
	
	page.openDialogTest = function () {
		var showDlgOps = {
			width: 900,
			height: 700,
			cancelClick: true
		};
		Ccay.UI.dialog("ccay/example/ui/igrid/menuFunction.html", "ccay.common.label.operation", showDlgOps);
	};
	
	page.openDemo = function (tabId) {
		$S("#operationDemo").getCcayTabManager().selectItem(tabId);
		$S("li[tabid='" + tabId + "']").click();
	};
	
});